package com.wedata.抖音;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.disdr.utils.DateUtils;
import com.wedata.HttpUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 抖音相关-千川投流
 * https://qianchuan.jinritemai.com/dataV2/report?aavid=1798453786988842
 *  切换账号：wegymer健萌-yw-01
 */
public class 巨量千川 {

    public static void main(String[] args) {
        //最近三天
        String url = "https://qianchuan.jinritemai.com/ad/api/data/v1/common/statQuery?reqFrom=cm_table&gfversion=1.0.0.4381&aavid=1798453786988842&msToken=CzVxBCgZTm-GYTPEjXuSOKkpf_c6xzc2-Ma1DOM1lWFdZ7TU1_QkjDnsRGgHx-Uts-cf0DEiYpAcBbTl1pWqoItLlOeU_w-gkadw6p7q04h3bsppuzhVJw%3D%3D&a_bogus=DfBQkch-Msm1rO6-Hhkz9tVDcO80YW58gZENdAI9C0LZ";
        JSONObject body = new JSONObject("{\"DataSetKey\":\"cm_prom_room_feed_room\",\"Metrics\":[\"stat_cost\",\"show_cnt\",\"ctr\",\"click_cnt\",\"cpm_platform\",\"all_order_pay_count_7days\",\"all_order_pay_gmv_7days\",\"pay_order_count\",\"pay_order_amount\",\"prepay_and_pay_order_roi\",\"qianchuan_first_order_cnt\",\"qianchuan_first_order_direct_pay_order_roi\",\"qianchuan_first_order_roi30\",\"qianchuan_author_first_order_direct_pay_order_roi\",\"qianchuan_author_first_order_cnt\",\"qianchuan_brand_first_order_cnt\",\"qianchuan_brand_first_order_direct_pay_order_roi\"],\"Dimensions\":[\"room_name\",\"room_icon\",\"room_start_time\",\"room_end_time\"],\"DrillDimensions\":[[\"stat_time_day\"]],\"Filters\":{\"ConditionRelationshipType\":1,\"Conditions\":[{\"Field\":\"advertiser_id\",\"Operator\":7,\"Values\":[\"1798453786988842\"]},{\"Field\":\"pricing_category\",\"Operator\":7,\"Values\":[\"2\"]},{\"Field\":\"marketing_goal\",\"Operator\":7,\"Values\":[\"2\"]},{\"Field\":\"ignore_all_metric_are_zero\",\"Operator\":7,\"Values\":[\"on\"]},{\"Field\":\"ignore_zero_dimension\",\"Operator\":7,\"Values\":[\"on\"]},{\"Field\":\"room_name\",\"Operator\":7,\"Values\":[\"\"]}]},\"StartTime\":\"2025-06-29 00:00:00\",\"EndTime\":\"2025-07-01 23:59:59\",\"OrderBy\":[{\"Type\":2,\"Field\":\"stat_cost\"}],\"PageParams\":{\"Limit\":10,\"Offset\":0},\"refer\":\"ecp,72890390004032307787281254696248016933cm_prom_room_feed_room\",\"aavid\":\"1798453786988842\"}");

        System.out.println(body.getJSONObject("PageParams"));

        System.out.println(body.getStr("StartTime"));
        System.out.println(body.getStr("EndTime"));


        int num = 3;//3/7/30
        Date currentDate = new Date();
        DateUtils.parseDate(currentDate);
        Date afterDate = DateUtils.addDays(currentDate,-num+1);
        System.out.println(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, afterDate) + " 00:00:00");
        System.out.println(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, currentDate) + " 23:59:59");

        Map<String,BigDecimal> statCostMap = new HashMap<>();
        //JSONObject result = HttpUtils.sendPost(url, getHeader(), body);
        JSONObject result = new JSONObject("{\"status_code\":0,\"data\":{\"StatsData\":{\"Totals\":{\"ctr\":{\"ValueStr\":\"10.00%\",\"Value\":10},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"4.30\",\"Value\":4.3},\"pay_order_amount\":{\"ValueStr\":\"26,848.42\",\"Value\":26848.42},\"stat_cost\":{\"ValueStr\":\"6,313.32\",\"Value\":6313.32},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"-\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.65\",\"Value\":1.65},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"60,554\",\"Value\":60554},\"click_cnt\":{\"ValueStr\":\"6,054\",\"Value\":6054},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"all_order_pay_count_7days\":{\"ValueStr\":\"461\",\"Value\":461},\"cpm_platform\":{\"ValueStr\":\"104.26\",\"Value\":104.26},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"31,216.80\",\"Value\":31216.8},\"pay_order_count\":{\"ValueStr\":\"383\",\"Value\":383},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"61\",\"Value\":61}},\"TotalCount\":\"3\",\"Rows\":[{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521572195445852954\",\"Value\":\"7521572195445852954\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 11:01:55\",\"Value\":\"2025-06-30 11:01:55\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 12:06:47\",\"Value\":\"2025-06-30 12:06:47\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"10.65%\",\"Value\":10.65},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"4.32\",\"Value\":4.32},\"pay_order_amount\":{\"ValueStr\":\"14,008.46\",\"Value\":14008.46},\"stat_cost\":{\"ValueStr\":\"3,280.12\",\"Value\":3280.12},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.95\",\"Value\":1.95},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"30,562\",\"Value\":30562},\"click_cnt\":{\"ValueStr\":\"3,256\",\"Value\":3256},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"all_order_pay_count_7days\":{\"ValueStr\":\"222\",\"Value\":222},\"cpm_platform\":{\"ValueStr\":\"107.33\",\"Value\":107.33},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"17,099.64\",\"Value\":17099.64},\"pay_order_count\":{\"ValueStr\":\"165\",\"Value\":165},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"32\",\"Value\":32}},\"Fields\":{},\"Rows\":[{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521572195445852954\",\"Value\":\"7521572195445852954\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 11:01:55\",\"Value\":\"2025-06-30 11:01:55\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"stat_time_day\":{\"ValueStr\":\"2025-06-30\",\"Value\":\"1751212800000\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 12:06:47\",\"Value\":\"2025-06-30 12:06:47\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"10.65%\",\"Value\":10.65},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"4.32\",\"Value\":4.32},\"pay_order_amount\":{\"ValueStr\":\"14,008.46\",\"Value\":14008.46},\"stat_cost\":{\"ValueStr\":\"3,280.12\",\"Value\":3280.12},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.95\",\"Value\":1.95},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"30,562\",\"Value\":30562},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"click_cnt\":{\"ValueStr\":\"3,256\",\"Value\":3256},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"all_order_pay_count_7days\":{\"ValueStr\":\"222\",\"Value\":222},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"17,099.64\",\"Value\":17099.64},\"cpm_platform\":{\"ValueStr\":\"107.33\",\"Value\":107.33},\"pay_order_count\":{\"ValueStr\":\"165\",\"Value\":165},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"32\",\"Value\":32}},\"Fields\":{}}]},{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521596954120342281\",\"Value\":\"7521596954120342281\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 12:38:15\",\"Value\":\"2025-06-30 12:38:15\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 13:24:05\",\"Value\":\"2025-06-30 13:24:05\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"9.55%\",\"Value\":9.55},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"3.63\",\"Value\":3.63},\"stat_cost\":{\"ValueStr\":\"2,009.53\",\"Value\":2009.53},\"pay_order_amount\":{\"ValueStr\":\"7,223.39\",\"Value\":7223.39},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.01\",\"Value\":1.01},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"17,978\",\"Value\":17978},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"click_cnt\":{\"ValueStr\":\"1,717\",\"Value\":1717},\"all_order_pay_count_7days\":{\"ValueStr\":\"128\",\"Value\":128},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"cpm_platform\":{\"ValueStr\":\"111.78\",\"Value\":111.78},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"8,457.95\",\"Value\":8457.95},\"pay_order_count\":{\"ValueStr\":\"110\",\"Value\":110},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"13\",\"Value\":13}},\"Fields\":{},\"Rows\":[{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521596954120342281\",\"Value\":\"7521596954120342281\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 12:38:15\",\"Value\":\"2025-06-30 12:38:15\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"stat_time_day\":{\"ValueStr\":\"2025-06-30\",\"Value\":\"1751212800000\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 13:24:05\",\"Value\":\"2025-06-30 13:24:05\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"9.55%\",\"Value\":9.55},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"3.63\",\"Value\":3.63},\"stat_cost\":{\"ValueStr\":\"2,009.53\",\"Value\":2009.53},\"pay_order_amount\":{\"ValueStr\":\"7,223.39\",\"Value\":7223.39},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.01\",\"Value\":1.01},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"17,978\",\"Value\":17978},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"click_cnt\":{\"ValueStr\":\"1,717\",\"Value\":1717},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"all_order_pay_count_7days\":{\"ValueStr\":\"128\",\"Value\":128},\"cpm_platform\":{\"ValueStr\":\"111.78\",\"Value\":111.78},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"8,457.95\",\"Value\":8457.95},\"pay_order_count\":{\"ValueStr\":\"110\",\"Value\":110},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"13\",\"Value\":13}},\"Fields\":{}}]},{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521628616485260059\",\"Value\":\"7521628616485260059\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 14:41:03\",\"Value\":\"2025-06-30 14:41:03\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 15:16:11\",\"Value\":\"2025-06-30 15:16:11\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"9.00%\",\"Value\":9},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"5.52\",\"Value\":5.52},\"pay_order_amount\":{\"ValueStr\":\"5,616.57\",\"Value\":5616.57},\"stat_cost\":{\"ValueStr\":\"1,023.67\",\"Value\":1023.67},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.94\",\"Value\":1.94},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"12,014\",\"Value\":12014},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"click_cnt\":{\"ValueStr\":\"1,081\",\"Value\":1081},\"all_order_pay_count_7days\":{\"ValueStr\":\"111\",\"Value\":111},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"cpm_platform\":{\"ValueStr\":\"85.21\",\"Value\":85.21},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"5,659.21\",\"Value\":5659.21},\"pay_order_count\":{\"ValueStr\":\"108\",\"Value\":108},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"16\",\"Value\":16}},\"Fields\":{},\"Rows\":[{\"Dimensions\":{\"room_id\":{\"ValueStr\":\"7521628616485260059\",\"Value\":\"7521628616485260059\"},\"room_start_time\":{\"ValueStr\":\"2025-06-30 14:41:03\",\"Value\":\"2025-06-30 14:41:03\"},\"room_icon\":{\"ValueStr\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\",\"Value\":\"{\\\"Uri\\\":\\\"webcast-cover/7368355944486718218\\\",\\\"UrlList\\\":[\\\"https://p3-webcast-sign.douyinpic.com/webcast-cover/7368355944486718218~tplv-qz53dukwul-image.image?lk3s=f4ae030d\\\\u0026x-expires=1753928690\\\\u0026x-signature=ZtBx0df08wqwxGIh22BBPqHBKnc%3D\\\"]}\"},\"room_name\":{\"ValueStr\":\"点外卖的进！！！\",\"Value\":\"点外卖的进！！！\"},\"stat_time_day\":{\"ValueStr\":\"2025-06-30\",\"Value\":\"1751212800000\"},\"room_end_time\":{\"ValueStr\":\"2025-06-30 15:16:11\",\"Value\":\"2025-06-30 15:16:11\"}},\"Metrics\":{\"ctr\":{\"ValueStr\":\"9.00%\",\"Value\":9},\"prepay_and_pay_order_roi\":{\"ValueStr\":\"5.52\",\"Value\":5.52},\"pay_order_amount\":{\"ValueStr\":\"5,616.57\",\"Value\":5616.57},\"stat_cost\":{\"ValueStr\":\"1,023.67\",\"Value\":1023.67},\"qianchuan_first_order_roi30\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_brand_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"qianchuan_author_first_order_direct_pay_order_roi\":{\"ValueStr\":\"1.94\",\"Value\":1.94},\"qianchuan_brand_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"qianchuan_first_order_direct_pay_order_roi\":{\"ValueStr\":\"0.00\",\"Value\":0},\"show_cnt\":{\"ValueStr\":\"12,014\",\"Value\":12014},\"click_cnt\":{\"ValueStr\":\"1,081\",\"Value\":1081},\"qianchuan_first_order_cnt\":{\"ValueStr\":\"0\",\"Value\":0},\"all_order_pay_count_7days\":{\"ValueStr\":\"111\",\"Value\":111},\"cpm_platform\":{\"ValueStr\":\"85.21\",\"Value\":85.21},\"all_order_pay_gmv_7days\":{\"ValueStr\":\"5,659.21\",\"Value\":5659.21},\"pay_order_count\":{\"ValueStr\":\"108\",\"Value\":108},\"qianchuan_author_first_order_cnt\":{\"ValueStr\":\"16\",\"Value\":16}},\"Fields\":{}}]}]}},\"message\":\"success\"}");
        JSONObject data = result.getJSONObject("data");
        JSONObject StatsData = data.getJSONObject("StatsData");
        JSONArray Rows = StatsData.getJSONArray("Rows");
        for (int i = 0; i < Rows.size(); i++) {
            JSONObject row = Rows.getJSONObject(i);
            JSONObject Dimensions = row.getJSONObject("Dimensions");
            JSONObject room_id = Dimensions.getJSONObject("room_id");
            String roomId = room_id.getStr("Value");
            JSONObject Metrics = row.getJSONObject("Metrics");
            JSONObject stat_cost = Metrics.getJSONObject("stat_cost");
            BigDecimal statCost = stat_cost.getBigDecimal("Value");
            statCostMap.put(roomId,statCost);
        }
        System.out.println(statCostMap);

    }

    private static JSONObject getHeader() {
        JSONObject header = new JSONObject();
        header.set("cookie","store-region=cn-hn; store-region-src=uid; ttwid=1%7CfLDD_y83V4SCevPbYy2tLoVO1mmt5G57IlSCPagjG2w%7C1750149898%7C87e56774b517582f006412c632356219c81150612d5abc3f1d0d1688326b5073; qc_tt_tag=0; passport_auth_status=2e3b8a64aa426b55b3a0bbaeb1a66fcb%2C; passport_auth_status_ss=2e3b8a64aa426b55b3a0bbaeb1a66fcb%2C; passport_csrf_token=ba028bb3adf8fdb0720a48f1e7d67f3b; passport_csrf_token_default=ba028bb3adf8fdb0720a48f1e7d67f3b; odin_tt=895d49002326559a2492ee2661782352f77af0835ed6b3708f78e1e9ac58ac474b119c5765d71e0413a803c8eca64ebae166e3246d1d2e2f24d08bf5135da6df; sid_guard=9d87be92a50a06b07140ab09e3d7e6e5%7C1751276286%7C5183942%7CFri%2C+29-Aug-2025+09%3A37%3A08+GMT; uid_tt=745db18163677f49b75be07a5dc1fdff; uid_tt_ss=745db18163677f49b75be07a5dc1fdff; sid_tt=9d87be92a50a06b07140ab09e3d7e6e5; sessionid=9d87be92a50a06b07140ab09e3d7e6e5; sessionid_ss=9d87be92a50a06b07140ab09e3d7e6e5; is_staff_user=false; sid_ucp_v1=1.0.0-KGFhM2UyYjZmMTU2NDQ1YjFjZDVhMWIyOGQxMTAzOGE4Y2JkZGM2MmEKGQjdy4CvlfSLBxD-tYnDBhimDCAMOAFA6wcaAmhsIiA5ZDg3YmU5MmE1MGEwNmIwNzE0MGFiMDllM2Q3ZTZlNQ; ssid_ucp_v1=1.0.0-KGFhM2UyYjZmMTU2NDQ1YjFjZDVhMWIyOGQxMTAzOGE4Y2JkZGM2MmEKGQjdy4CvlfSLBxD-tYnDBhimDCAMOAFA6wcaAmhsIiA5ZDg3YmU5MmE1MGEwNmIwNzE0MGFiMDllM2Q3ZTZlNQ; s_v_web_id=verify_mciwolxp_LHsLSIOH_smqF_4r7Z_Ah9S_7HLesOJz6uLQ; _tea_utm_cache_2906=undefined; gfkadpd=4333,38403|4333,34747|4333,31774|4333,31784; csrftoken=6pdMob1Z-Ms_zNUyztQgFK04q2B0ZzUwpT68; gd_random=eyJtYXRjaCI6dHJ1ZSwicGVyY2VudCI6MC45MDQyNDEzMDQzNTIyOTg5fQ==.3ccSe2sce3AzN5o+DLWwITpGDNeP+y1A6S17Np2bzj0=");
        return header;
    }
}
